package com.lyz.util;
/**
 * id转换服务工具
 * @author Qiyi
 *
 */
public class IdTransferUtil {
	/**
	 * 获取伪造的id
	 * @param id
	 * @return
	 */
	public static long getFakeID(long id){
        if(id>2147483647L) {
            int ids= (int)((id - 2147483647L)/100);
            if(ids>18000000){
               return id;
            }else{
               return (ids + 2000000) * 100 + 99;
            }
        }else{
           return id;
        }
  }
  /**
   * 获取真实id
   * @param id
   * @return
   */
  public static long getRealID(long id){
        long ids=id%100;
        if(ids==99&&id>200000099L && id < 2000000099L) {
            return  (id-99-2000000 * 100+ 2147483647 + 62);
        }else{
           return id;
        }
  }

}
